-module(appc_gateway).

-export([get_name/0,get_des/0,get_des/1,write/0]).

get_name() -> gateway.

%% {one_for_one, 3, 10},{simple_one_for_one, 10, 10}
%% temporary permanent
get_des() ->
	[
	{dbm,true},
	{table,"null"},
%% 	{rel,"{erts, \"5.9\"}",["{kernel, \"2.16.1\"}","{stdlib, \"1.19.1\"}","{syslog, \"0.0.1\"}"]},
	{rel,"{erts, \"5.9\"}",["{kernel, \"2.16.1\"}","{stdlib, \"1.19.1\"}"]},
	{config,["{cookie, satan}, {dbm, 'dbm@192.168.1.185'}, {name, 'gateway1@192.168.1.185'}, {id, 1},{max,250}"]},
	{sup_des,{{restart_strategy,"{one_for_one, 3, 100000}"},{sup_list,[
														 {agentCtr,agentCtr,"permanent","5000",worker},
														 {agent_sup,agent_sup,"permanent","5000",supervisor}
														]}}}			
	].

get_des(agentCtr)->
	[
	{worker_des,[
		{global,false}
		]}	
	];
get_des(agent_sup)->
	[
	{sup_des,{{restart_strategy,"{simple_one_for_one, 10, 10}"},{sup_list,[
														 {agent,agent,"temporary","2000",worker}
														]}}}			
	];
get_des(agent)->
	[
	{worker_des,[
		{global,false}
		]}	
	].


write() ->
	write_ctrl:write(app,?MODULE).